import axios from 'axios';

export const BASEURL = 'http://localhost:3000';

const service = axios.create({
  baseURL: process.env.VUE_APP_BASE_API,
  timeout: 20000
});

service.interceptors.request.use(config => {
  return config;
});

service.interceptors.response.use(
  result => {
    return result.data;
  },
  err => {
    return Promise.reject(err);
  }
);

export default service;
